package org.lg.dto;

import java.io.IOException;
import java.util.Properties;

/**
 * 主要用于存放各种提示信息
 * @author:LG
 * @date:Created at 2019/03/09
 */
public class Messages {
    //学生模块
    private static String getAllStudentSuccess= "";
    private static String getAllStudentFail= "";
    private static String getStudentByIdSuccess= "";
    private static String getStudentByIdFail= "";
    private static String addStudentSuccess= "";



    //教师模块
    private static String getTeachersSuccess= "";
    private static String getAllTeacherSuccess= "";
    private static String getAllTeacherFail= "";
    private static String getTeacherByIdSuccess= "";
    private static String getTeacherByIdFail= "";
    private static String addTeacherSuccess= "";


    //登录
    private static String loginSuccess= "";
    private static String loginUserNameFail= "";
    private static String loginPasswordFail= "";



   static{
       Properties prop = new Properties();// 空的配置类
       try {
           prop.load(Messages.class.getResourceAsStream("/messages.properties"));// Object.class找到jvm运行的class文件所在的目录，
       } catch (IOException e) {
           e.printStackTrace();
       }
       // getResourceAsStream 以流的形式将文件读到内存，不写/ 根路径表示当前class所在的文件夹下面找文件 写
       // 根路径就是当前项目下面找文件 bin
       getAllStudentSuccess = prop.get("getAllStudentSuccess").toString();
       getAllStudentFail = prop.get("getAllStudentFail").toString();
       getStudentByIdSuccess = prop.get("getStudentByIdSuccess").toString();
       addStudentSuccess = prop.get("addStudentSuccess").toString();


       //教师模块
       getTeachersSuccess = prop.get("getTeachersSuccess").toString();
       getAllTeacherSuccess = prop.get("getAllTeacherSuccess").toString();
       getAllTeacherFail = prop.get("getAllTeacherFail").toString();
       getTeacherByIdSuccess = prop.get("getTeacherByIdSuccess").toString();
       addTeacherSuccess = prop.get("addTeacherSuccess").toString();

       getStudentByIdFail = prop.get("getStudentByIdFail").toString();

       //登录
       loginSuccess = prop.get("loginSuccess").toString();
       loginUserNameFail = prop.get("loginUserNameFail").toString();
       loginPasswordFail = prop.get("loginPasswordFail").toString();

   }
    /*会员模块操作信息*/
    public final static String GETALLSTUDENTSUCCESS= getAllStudentSuccess;
    public final static String GETALLSTUDENTFAIL= getAllStudentFail;
    public final static String GETSTUDENTBYIDSUCCESS= getStudentByIdSuccess;
    public final static String GETSTUDENTBYIDFAIL= getStudentByIdFail;
    public final static String ADDSTUDENTSUCCESS= addStudentSuccess;
    


    //教师模块
    public final static String GETEACHERSUCCESS= getTeachersSuccess;
    public final static String GETALLTEACHERSUCCESS= getAllTeacherSuccess;
    public final static String GETALLTEACHERFAIL= getAllTeacherFail;
    public final static String GETTEACHERBYIDSUCCESS= getTeacherByIdSuccess;
    public final static String GETTEACHERBYIDFAIL= getTeacherByIdFail;
    public final static String ADDTEACHERSUCCESS= addTeacherSuccess;

    //登录
    public final static String LOGINSUCCESS= loginSuccess;
    public final static String LOGINUSERNAMEFAIL= loginUserNameFail;
    public final static String LOGINPASSWORDFAIL= loginPasswordFail;




    public static void main(String[] args) {

    }

}
